import { request } from '@/app/http'

export async function getSystemInfo() {
  const { data } = await request({
    url: '/welcome/systemInfo',
    method: 'get',
    showLoading: true,
    showErr: true
  })
  return data
}

export async function getCaptcha() {
  const { data } = await request({
    url: '/code/captcha',
    method: 'get',
    showErr: true
  })
  return data
}

export function sendSmsCode(data) {
  return request({
    url: '/code/smsCode',
    method: 'post',
    data,
    showLoading: true,
    showMsg: true
  })
}

export function uploadFile(data) {
  return request({
    url: '/file/upload',
    method: 'post',
    data,
    showLoading: true,
    showMsg: true
  })
}

export function batchUploadFile(data) {
  return request({
    url: '/file/batchUpload',
    method: 'post',
    data,
    showLoading: true,
    showMsg: true
  })
}

export function downloadFile(params) {
  return request({
    url: '/file/download',
    method: 'get',
    params,
    showLoading: true,
    showMsg: true
  })
}

export function mapDict(params) {
  return request({
    url: '/dictDetail/map',
    method: 'get',
    params
  })
}

export async function allArea(params) {
  const { data } = await request({
    url: '/province/all',
    method: 'get',
    params
  })
  return data
}
